<template>
  <div id="app">
    <router-view />
    <van-tabbar :route="true" v-if="flag">
      <van-tabbar-item icon="home-o" to="/">首页</van-tabbar-item>
      <van-tabbar-item icon="apps-o" to="/classify">分类</van-tabbar-item>
      <van-tabbar-item icon="gem-o" to="/optimization">优选</van-tabbar-item>
      <van-tabbar-item icon="cart-o" to="/shopc">购物车</van-tabbar-item>
      <van-tabbar-item icon="user-o" to="/me">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>
<script>
export default {
  data () {
    return {
      flag: true
    }
  },
  watch: {
    '$route': function (val) {
      // console.log(val)
      if (val.path !== '/' && val.path !== '/classify' && val.path !== '/me') {
        this.flag = false
      } else {
        this.flag = true
      }
    }
  }
}
</script>
